//
//  MultiSelectionCell.m
//  18Birdies
//
//  Created by Lc on 15/5/14.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import "LcFoundation.h"
#import "MultiSelectionCell.h"
#import "MultiSelectionCellData.h"

@implementation MultiSelectionCell

- (void)postContruct {
  [super postContruct];
  self.selectedBackgroundView.backgroundColor = [UIColor clearColor];
  [self.titleLabel setLcFont:[LcFont dr17]];
  [self.rightButton setLcFont:[LcFont db14]];
  [self.rightButton addTarget:self
                       action:@selector(onRightButtonClicked)
             forControlEvents:UIControlEventTouchUpInside];
  self.titleLabel.preferredMaxLayoutWidth =
      [LcUIUtility screenWidth] - 50 - self.rightButton.width;
}

- (void)onRightButtonClicked {
  LC_CHECK_NOT_NULL(self.cellData);
  MultiSelectionCellData* multiSelectionCellData =
      (MultiSelectionCellData*)self.cellData;
  if (multiSelectionCellData.delegate != nil) {
    [multiSelectionCellData.delegate
        onMultiSelectionRightButtonClicked:multiSelectionCellData];
  }
}
@end
